package com.hsc.yalebao.tools;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.text.TextUtils;
import java.io.PrintStream;

public class SharedPreferencesUtil
{
  public static SharedPreferencesUtil instance;
  public SharedPreferences sp;

  public SharedPreferencesUtil(Context paramContext)
  {
    if (this.sp == null)
      this.sp = paramContext.getSharedPreferences("sys_config", 0);
  }

  public static SharedPreferencesUtil getInstance(Context paramContext)
  {
    if (instance == null)
      instance = new SharedPreferencesUtil(paramContext);
    return instance;
  }

  public boolean checkExist(String paramString1, String paramString2)
  {
    if (((paramString1 != null) && (paramString1.equals(""))) || ((paramString2 != null) && (paramString2.equals(""))));
    while (paramString2.indexOf(paramString1) < 0)
      return false;
    return true;
  }

  public String getValue(String paramString1, String paramString2)
  {
    return this.sp.getString(paramString1, paramString2);
  }

  public boolean getValuesBoolean(String paramString)
  {
    return this.sp.getBoolean(paramString, true);
  }

  public boolean hasNoRead(int paramInt)
  {
    String str = getValue("message", "");
    System.out.println("本地保存已读消息ID：" + str);
    String[] arrayOfString = str.split(",");
    boolean bool = false;
    if (arrayOfString != null)
    {
      System.out.println("获取本地保存已读消息个数=" + arrayOfString.length);
      if (paramInt > arrayOfString.length)
        bool = true;
    }
    else
    {
      return bool;
    }
    return false;
  }

  public void putHasReadMessage(String paramString)
  {
    String str1 = getValue("message", "").trim();
    if (TextUtils.isEmpty(str1));
    for (String str2 = paramString; ; str2 = str1 + "," + paramString)
    {
      SharedPreferences.Editor localEditor = this.sp.edit();
      localEditor.putString("message", str2);
      localEditor.commit();
      return;
    }
  }

  public void setBooleanValue(String paramString, boolean paramBoolean)
  {
    SharedPreferences.Editor localEditor = this.sp.edit();
    localEditor.putBoolean(paramString, paramBoolean);
    localEditor.commit();
  }

  public void setValue(String paramString, Object paramObject)
  {
    SharedPreferences.Editor localEditor = this.sp.edit();
    localEditor.putString(paramString, String.valueOf(paramObject));
    localEditor.commit();
  }

  public void setValues(String paramString, boolean paramBoolean)
  {
    SharedPreferences.Editor localEditor = this.sp.edit();
    localEditor.putBoolean(paramString, paramBoolean);
    localEditor.commit();
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tools.SharedPreferencesUtil
 * JD-Core Version:    0.6.2
 */